package com.efounder.frame.manager;

import android.content.Context;

import java.io.File;

import skin.support.load.SkinSDCardLoader;

/**
 * 换肤框架(自定义存储卡加载皮肤包的工具类)
 *
 * @author YQS
 */
public class CustomSDCardLoader extends SkinSDCardLoader {
    public static final int SKIN_LOADER_STRATEGY_SDCARD = Integer.MAX_VALUE;
    private String skinDir;

    public CustomSDCardLoader(String skinDir) {
        this.skinDir = skinDir;
    }

    @Override
    protected String getSkinPath(Context context, String skinName) {

        String skinFolderPath = skinDir;
        return new File(skinFolderPath, skinName).getAbsolutePath();
    }

    @Override
    public int getType() {
        return SKIN_LOADER_STRATEGY_SDCARD;
    }
}